package com.shsmi.jc.seed.common;

import java.util.Date;


public class MyHttpResponse {
    private final Boolean success;
    private final String message;
    private final ErrorCode errorCode;
    private final Object data;
    private final Date timestamp;

    protected MyHttpResponse(Boolean success, final Object data, final String message, final ErrorCode errorCode) {
        this.message = message;
        this.errorCode = errorCode;
        this.success = success;
        this.data = data;
        this.timestamp = new Date();
    }

    public static MyHttpResponse of(Boolean success, final Object data, final String message, final ErrorCode errorCode) {
        return new MyHttpResponse(success, data, message, errorCode);
    }

    public Boolean getStatus() {
        return success;
    }

    public String getMessage() {
        return message;
    }

    public ErrorCode getErrorCode() {
        return errorCode;
    }

    public Object getData() {
        return data;
    }

    public Date getTimestamp() {
        return timestamp;
    }
}
